//
//  UIImage+Extension.m
//  CC
//
//  Created by Calvin on 4/19/15.
//  Copyright (c) 2015 Calvin. All rights reserved.
//

#import "UIImage+Extension.h"

@implementation UIImage (Extension)
+(UIImage *)imageWithName:(NSString *)name{
    UIImage *image=nil;
    if (iOS7) {
        NSString *newName = [name stringByAppendingString:@"_os7"];
        image =[UIImage imageNamed:newName];
    }
    
    if (image==nil) {
        image =[UIImage imageNamed:name];
    }
    
    return image;
}

+ (UIImage *)resizedImage:(NSString *)name
{
    UIImage *image = [UIImage imageWithName:name];
    return [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
}
@end
